home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 October / macformat-029.iso / mac / Shareware City / HyperCard / CapsLock / CapsLock readme < prev    next >
Encoding:
Text File  |  1995-04-11  |  4.8 KB  |  98 lines  |  [TEXT/MSWD]

  1. CapsLock XFCN 1.0
  2. ©1995 Theron Trowbridge
  3. (Portions copyright Apple and Symantec)
  4.  
  5.  
  6.  
  7. •    WHY DID I DO THIS?
  8.  
  9. One day last week, my boss was asking me if there was any way in Hypercard to detect if the Caps Lock was on or not.  He was trying to use it as a toggle between "modes" and I rather liked the idea.  There is no way to do it built-in to HC, though, so I said to myself, "I bet it would take about five minutes to write an XFCN to do it."
  10.  
  11. About a half hour later, I realized it wasn't quite so easy.  Inside Mac is written for Pascal, I'm using C, and there's some important differences that no one bothers to tell you about.  I am indebted to David Hay <hay@nag.cs.colorado.edu> for getting me the crucial information I needed.
  12.  
  13.  
  14.  
  15. •    WHAT IS IT?
  16.  
  17. CapsLock is an XFCN, which is a resource you attach to a Hypercard stack to extend its functionality.  You need to copy CapsLock into any stack that you want to use it in.  You can also copy CapsLock to your Home stack or the HyperCard application itself, in which case all stacks can use it.  If you make a stack that you expect other people to use, be sure to include the XFCN in the stack itself.
  18.  
  19. There are a variety of programs you can use to get the XFCN into your stack. ResEdit is a resource editing program available from Apple.  ResCopy is a Hypercard stack that copies resources.  There are others, as well, but those are the two I know about.
  20.  
  21. The ID of the resource is not critical and can be changed in the event that there is already a XFCN with that resource ID number.
  22.  
  23.  
  24.  
  25. •    HOW DOES IT WORK?
  26.  
  27. The CapsLock XFCN takes the form:
  28.  
  29.     CapsLock()
  30.  
  31. and it returns "down" if Caps Lock is on and "up" if it is not.
  32.  
  33. Example:
  34.  
  35.     if CapsLock() is down then answer "Caps Lock is on"
  36.  
  37. While I tried to retain the same sort of functionality as the ShiftKey(), CmdKey(), etc... functions, you cannot use the form:
  38.  
  39.     the CapsLock
  40.  
  41. as that is reserved for built-in functions only.  Boo!  Hiss!
  42.  
  43. CapsLock usually ignores any parameters passed to it.  There are two exceptions:
  44.  
  45.     CapsLock("!")    -- returns copyright information
  46.     CapsLock("?")    -- returns syntax information
  47.  
  48.  
  49.  
  50. •    SYSTEM/HARDWARE REQUIREMENTS
  51.  
  52. This XFCN should work without problem on just about any Macintosh.  I didn't do anything other than basic calls in Inside Macintosh I-III, so I don't see why it shouldn't work on older systems as well.  The sample stack is in Hypercard 2.x format, though, so it needs at least system 6.0.5 to run.
  53.  
  54. This XFCN was intended to be used with U.S. keyboards, but it looks like the Caps Lock key is addressed the same way on at least U.K. keyboards as well.  I don't know if all keyboards in the world have a Caps Lock key, nor if they are always in the same (logical) place as far as the Mac is concerned.  It is more than possible that this XFCN will not work with some non-U.S. Macintoshes.
  55.  
  56. If it does not work on your Macintosh, let me know.  Be sure to include information on what type of machine, country, system software, and version of Hypercard.
  57.  
  58.  
  59.  
  60. •    LEGAL STUFF
  61.  
  62. This XFCN is free for any and all use.  No fees.  No acknowledgment.  No nothing.  This should be something that Hypercard can do by itself, anyway, it seems to me.  I want everybody and their pet dog to be able to use CapsLock freely.
  63.  
  64. Included with this archive is the Think C 6.0 project.  You should be able to easily adapt it to another compiler.  Be sure to include MacTraps and HyperXLib.
  65.  
  66. Included with the source is a header file "XCmdStuff.h" that I wrote to do some things that I found myself doing a lot in the XCMDs I wrote.  If you're trying to learn how to write XCMDs or XFCNs, you may find this helpful.  Or not.  In any event, it is also free for you to use.
  67.  
  68. Though they are free for you to use, I retain copyright to both the XFCN and the code.  This XFCN/code may be included in a CD-ROM software collection, but please send me a copy of the CD-ROM.
  69.  
  70.  
  71.  
  72. •    HOW TO REACH ME
  73.  
  74. If you have any problems, questions, comments, etc., you can send them to:
  75.  
  76. e-mail:
  77.     theron@aimla.com
  78.  
  79. snail-mail:
  80.     Theron Trowbridge
  81.     3685 Jasmine Ave. #19
  82.     Los Angeles, CA 90034
  83.  
  84.  
  85.  
  86. •    ABOUT ME AND MY XCMDS
  87.  
  88. I have a growing collection of XCMDs and XFCNs I have made to do various things.  I keep telling myself I will release it some day - "when it's ready."  I have no idea when I will consider it ready, but if you're interested, I can send you what I've got.  I'm not sure how many of them are of use to the general public.  But you never know.
  89.  
  90. My journey into XCMD programming was a tough one, and I would never have been able to do it without the help of others - sometimes complete strangers over the internet.  I am more than willing to pass along the favor and help out anyone out there with programming, either XCMD/XFCN related, or general Macintosh applications.  I'm still learning, but what I've learned I'm willing to pass along to others.
  91.  
  92.  
  93.  
  94. •    VERSION HISTORY
  95.  
  96. 1.0 - First release.
  97.  
  98.